import request from '@/http/request';

const getTeachers = () => {
    return request({
        url: '/employee/list',
        method: 'get'
    })
}

const getTeacherById = (id) => {
    return request({
        url:`/employee/get`,
        method: 'get',
        params:{
            id: id
        }
    })
}

const addTeacher = (teacher) => {
    return request({
        url: '/employee/add',
        method: 'post',
        data: teacher
    })
}

const editTeacher = (teacher) => {
    return request({
        url: '/employee/update',
        method: 'put',
        data: teacher
    })
}

const deleteTeacher = (id) => {
    return request({
        url: `/employee/delete/${id}`,
        method: 'delete',
    })
}

export default {
    getTeachers,
    getTeacherById,
    addTeacher,
    editTeacher,
    deleteTeacher
};
